package com.care.service;

import java.util.List;

import javax.annotation.Resource;
import javax.transaction.Transactional;

import org.springframework.stereotype.Service;

import com.care.dao.consult.ConsultDaoImpl;
import com.care.entity.Consult;
import com.care.entity.Doctor;
import com.care.entity.User;
import com.sun.org.apache.regexp.internal.recompile;

@Service
@Transactional
public class ConsultServiceImpl {
	@Resource
	private ConsultDaoImpl impl;
	/**
	 * 根据dc查询consult表
	 * @param doctor
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	 public List<Consult> findConsultBydc(Doctor doctor,int pageNum,int pageSize){
		return impl.findConsultBydc(doctor, pageNum, pageSize);		 
	 }
	 /**
	  * 计算consult表dc数据总数
	  * @param doctor
	  * @return
	  */
	 public int countCoultBydc(Doctor doctor){
		 return impl.countCoultBydc(doctor);
	 }
	  /**
	   * 根据uc查询consult表
	   * @param doctor
	   * @param pageNum
	   * @param pageSize
	   * @return
	   */
	  public List<Consult> findConsultByuc(User user,int pageNum,int pageSize){
		  return impl.findConsultByuc(user, pageNum, pageSize);
	  }
	  /**
	   * 计算consult表uc数据总数
	   * @param doctor
	   * @return
	   */
	  public int countCoultByuc(User user){
		  return impl.countCoultByuc(user);
	  }
	  
	  /**
	   * 判断修改的金额
	   * 并更改用户额
	   * @param consult
	   * @param user
	 * @return 
	   */
	  public boolean updateConsult(Consult consult,User user,int id){
		  return impl.updateConsult(consult, user,id);
	  }
	  /**
	   * 用户聊天功能(修改content实现)
	   * @param consult
	   * @param id
	   */
	  public void updateConsultUser(Consult consult,int id){
		  impl.updateConsultUser(consult, id);
	  }
	  /**
	   * 医生聊天功能(修改answer实现)
	   * @param consult
	   * @param id
	   */
	  public void updateConsultDoctor(Consult consult,int id){
		  impl.updateConsultDoctor(consult, id);
	  }
	  /**
	   * 诊断为病人
	   * @param consult
	   * @param doctor
	   * @param id
	   */
	  public void updateConsultDoctorMoney(Consult consult,Doctor doctor,int id){
		  impl.updateConsultDoctorMoney(consult, doctor, id);
	  }
	  /**
	   * 诊断后无病
	   * @param consult
	   * @param user
	   * @param id
	   */
	  public void updateConsultDoctorPatient(Consult consult,String email,int id){
		  impl.updateConsultDoctorPatient(consult, email, id);
	  }
}
